/**
Filename : ShowMessageController.java
Date     : 2015年10月30日
Author   : qp.wu@suirui.com
Company  : Suirui Co.,Ltd.
*/
package org.wuqiupeng.main;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.wuqiupeng.entity.UserRecord;
import org.wuqiupeng.service.TestService;


@Controller
public class ShowMessageController {

	@Autowired
	private TestService testService;
	
    @RequestMapping("/showmessage")
    public String showmessage(Model model){
    	System.out.println("ShowMessageController..");
    	List<UserRecord> users = testService.getAllUser();
    	for (UserRecord userRecord : users) {
			System.out.println("username = " + userRecord.getUsername());
		}
    	model.addAttribute("users", users);
        return "showMessage";
    }
}

